package com.git.contractmanagement.repository;

import com.git.contractmanagement.entity.Contract;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContractRepository extends JpaRepository<Contract, Integer>, JpaSpecificationExecutor<Contract> {

    Page<Contract> findAll(Specification<Contract> spec, Pageable pageable);
    // 根据ID列表查询合同
    List<Contract> findAllById(Iterable<Integer> ids);
}